<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>WASM Loading Test</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      max-width: 800px;
      margin: 0 auto;
      padding: 20px;
    }
    #console {
      background-color: #f4f4f4;
      border: 1px solid #ddd;
      border-radius: 4px;
      padding: 15px;
      white-space: pre-wrap;
      font-family: monospace;
      height: 200px;
      overflow-y: auto;
      margin-top: 20px;
    }
  </style>
</head>
<body>
  <h1>WebAssembly Loading Test</h1>
  <p>This page tests the direct loading of a WebAssembly module.</p>
  
  <div id="console"></div>
  
  <script>
    // Override console.log to display in the page
    const consoleDiv = document.getElementById('console');
    const originalConsoleLog = console.log;
    const originalConsoleError = console.error;
    
    console.log = function() {
      const args = Array.from(arguments);
      const line = document.createElement('div');
      line.textContent = args.map(arg => 
        typeof arg === 'object' ? JSON.stringify(arg) : arg
      ).join(' ');
      consoleDiv.appendChild(line);
      originalConsoleLog.apply(console, args);
    };
    
    console.error = function() {
      const args = Array.from(arguments);
      const line = document.createElement('div');
      line.style.color = 'red';
      line.textContent = args.map(arg => 
        typeof arg === 'object' ? JSON.stringify(arg) : arg
      ).join(' ');
      consoleDiv.appendChild(line);
      originalConsoleError.apply(console, args);
    };
  </script>
  <script src="test-wasm.js"></script>
</body>
</html> 